package com.gotop.system.service.impl.system;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gotop.common.redis.CacheNames;
import com.gotop.entity.system.Dict;
import com.gotop.mapper.system.DictDao;
import com.gotop.system.service.system.IDictService;
import lombok.AllArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @program: cem
 * @description:
 * @author: superfish
 * @create: 2020-12-22 11:44
 **/
@Service
@AllArgsConstructor
public class DictServiceImpl extends ServiceImpl<DictDao, Dict> implements IDictService {

    @Override
    @Cacheable(cacheNames = CacheNames.DICT_VALUE, key = "#code+'_'+#dictKey")
    public String getValue(String code, Integer dictKey) {
        return baseMapper.getValue(code, dictKey);
    }
}
